3.177 \(\int \frac {(h+i x)^2 (a+b \log (c (e+f x)))}{d e+d f x} \, dx\)

Optimal. Leaf size=157 \[ \frac {(f h-e i)^2 \log (e+f x) (a+b \log (c (e+f x)))}{d f^3}+\frac {2 i (e+f x) (f h-e i) (a+b \log (c (e+f x)))}{d f^3}+\frac {i^2 (e+f x)^2 (a+b \log (c (e+f x)))}{2 d f^3}-\frac {b (-3 e i+4 f h+f i x)^2}{4 d f^3}-\frac {b (f h-e i)^2 \log ^2(e+f x)}{2 d f^3} \]

[Out]

-1/4*b*(f*i*x-3*e*i+4*f*h)^2/d/f^3-1/2*b*(-e*i+f*h)^2*ln(f*x+e)^2/d/f^3+2*i*(-e*i+f*h)*(f*x+e)*(a+b*ln(c*(f*x+
e)))/d/f^3+1/2*i^2*(f*x+e)^2*(a+b*ln(c*(f*x+e)))/d/f^3+(-e*i+f*h)^2*ln(f*x+e)*(a+b*ln(c*(f*x+e)))/d/f^3

________________________________________________________________________________________

Rubi [A]  time = 0.26, antiderivative size = 133, normalized size of antiderivative = 0.85, number of steps used = 7, number of rules used = 6, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2411, 12, 43, 2334, 14, 2301} \[ \frac {\left (\frac {4 i (e+f x) (f h-e i)}{f^2}+\frac {2 (f h-e i)^2 \log (e+f x)}{f^2}+\frac {i^2 (e+f x)^2}{f^2}\right ) (a+b \log (c (e+f x)))}{2 d f}-\frac {b (-3 e i+4 f h+f i x)^2}{4 d f^3}-\frac {b (f h-e i)^2 \log ^2(e+f x)}{2 d f^3} \]

Antiderivative was successfully verified.

[In]

Int[((h + i*x)^2*(a + b*Log[c*(e + f*x)]))/(d*e + d*f*x),x]

[Out]

-(b*(4*f*h - 3*e*i + f*i*x)^2)/(4*d*f^3) - (b*(f*h - e*i)^2*Log[e + f*x]^2)/(2*d*f^3) + (((4*i*(f*h - e*i)*(e
+ f*x))/f^2 + (i^2*(e + f*x)^2)/f^2 + (2*(f*h - e*i)^2*Log[e + f*x])/f^2)*(a + b*Log[c*(e + f*x)]))/(2*d*f)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2334

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]
] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rule 2411

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + (g_.)*(x_))^(q_.)*((h_.) + (i_.)*(x_))
^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[((g*x)/e)^q*((e*h - d*i)/e + (i*x)/e)^r*(a + b*Log[c*x^n])^p, x], x,
d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, n, p, q, r}, x] && EqQ[e*f - d*g, 0] && (IGtQ[p, 0] || IGtQ[
r, 0]) && IntegerQ[2*r]

Rubi steps

\begin {align*} \int \frac {(h+177 x)^2 (a+b \log (c (e+f x)))}{d e+d f x} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\left (\frac {-177 e+f h}{f}+\frac {177 x}{f}\right )^2 (a+b \log (c x))}{d x} \, dx,x,e+f x\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \frac {\left (\frac {-177 e+f h}{f}+\frac {177 x}{f}\right )^2 (a+b \log (c x))}{x} \, dx,x,e+f x\right )}{d f}\\ &=-\frac {\left (\frac {708 (177 e-f h) (e+f x)}{f^2}-\frac {31329 (e+f x)^2}{f^2}-\frac {2 (177 e-f h)^2 \log (e+f x)}{f^2}\right ) (a+b \log (c (e+f x)))}{2 d f}-\frac {b \operatorname {Subst}\left (\int \frac {-177 (708 e-4 f h-177 x) x+2 (-177 e+f h)^2 \log (x)}{2 f^2 x} \, dx,x,e+f x\right )}{d f}\\ &=-\frac {\left (\frac {708 (177 e-f h) (e+f x)}{f^2}-\frac {31329 (e+f x)^2}{f^2}-\frac {2 (177 e-f h)^2 \log (e+f x)}{f^2}\right ) (a+b \log (c (e+f x)))}{2 d f}-\frac {b \operatorname {Subst}\left (\int \frac {-177 (708 e-4 f h-177 x) x+2 (-177 e+f h)^2 \log (x)}{x} \, dx,x,e+f x\right )}{2 d f^3}\\ &=-\frac {\left (\frac {708 (177 e-f h) (e+f x)}{f^2}-\frac {31329 (e+f x)^2}{f^2}-\frac {2 (177 e-f h)^2 \log (e+f x)}{f^2}\right ) (a+b \log (c (e+f x)))}{2 d f}-\frac {b \operatorname {Subst}\left (\int \left (-177 (708 e-4 f h-177 x)+\frac {2 (177 e-f h)^2 \log (x)}{x}\right ) \, dx,x,e+f x\right )}{2 d f^3}\\ &=-\frac {b (531 e-4 f h-177 f x)^2}{4 d f^3}-\frac {\left (\frac {708 (177 e-f h) (e+f x)}{f^2}-\frac {31329 (e+f x)^2}{f^2}-\frac {2 (177 e-f h)^2 \log (e+f x)}{f^2}\right ) (a+b \log (c (e+f x)))}{2 d f}-\frac {\left (b (177 e-f h)^2\right ) \operatorname {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,e+f x\right )}{d f^3}\\ &=-\frac {b (531 e-4 f h-177 f x)^2}{4 d f^3}-\frac {b (177 e-f h)^2 \log ^2(e+f x)}{2 d f^3}-\frac {\left (\frac {708 (177 e-f h) (e+f x)}{f^2}-\frac {31329 (e+f x)^2}{f^2}-\frac {2 (177 e-f h)^2 \log (e+f x)}{f^2}\right ) (a+b \log (c (e+f x)))}{2 d f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.15, size = 214, normalized size = 1.36 \[ \frac {2 a^2 e^2 i^2-4 a^2 e f h i+2 a^2 f^2 h^2+2 b \log (c (e+f x)) \left (2 a (f h-e i)^2+b i \left (-2 e^2 i+e f (4 h-2 i x)+f^2 x (4 h+i x)\right )\right )-4 a b e f i^2 x+8 a b f^2 h i x+2 a b f^2 i^2 x^2+2 b^2 (f h-e i)^2 \log ^2(c (e+f x))-2 b^2 e^2 i^2 \log (e+f x)+6 b^2 e f i^2 x-8 b^2 f^2 h i x-b^2 f^2 i^2 x^2}{4 b d f^3} \]

Antiderivative was successfully verified.

[In]

Integrate[((h + i*x)^2*(a + b*Log[c*(e + f*x)]))/(d*e + d*f*x),x]

[Out]

(2*a^2*f^2*h^2 - 4*a^2*e*f*h*i + 2*a^2*e^2*i^2 + 8*a*b*f^2*h*i*x - 8*b^2*f^2*h*i*x - 4*a*b*e*f*i^2*x + 6*b^2*e
*f*i^2*x + 2*a*b*f^2*i^2*x^2 - b^2*f^2*i^2*x^2 - 2*b^2*e^2*i^2*Log[e + f*x] + 2*b*(2*a*(f*h - e*i)^2 + b*i*(-2
*e^2*i + e*f*(4*h - 2*i*x) + f^2*x*(4*h + i*x)))*Log[c*(e + f*x)] + 2*b^2*(f*h - e*i)^2*Log[c*(e + f*x)]^2)/(4
*b*d*f^3)

________________________________________________________________________________________

fricas [A]  time = 0.44, size = 170, normalized size = 1.08 \[ \frac {{\left (2 \, a - b\right )} f^{2} i^{2} x^{2} + 2 \, {\left (b f^{2} h^{2} - 2 \, b e f h i + b e^{2} i^{2}\right )} \log \left (c f x + c e\right )^{2} + 2 \, {\left (4 \, {\left (a - b\right )} f^{2} h i - {\left (2 \, a - 3 \, b\right )} e f i^{2}\right )} x + 2 \, {\left (b f^{2} i^{2} x^{2} + 2 \, a f^{2} h^{2} - 4 \, {\left (a - b\right )} e f h i + {\left (2 \, a - 3 \, b\right )} e^{2} i^{2} + 2 \, {\left (2 \, b f^{2} h i - b e f i^{2}\right )} x\right )} \log \left (c f x + c e\right )}{4 \, d f^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x+h)^2*(a+b*log(c*(f*x+e)))/(d*f*x+d*e),x, algorithm="fricas")

[Out]

1/4*((2*a - b)*f^2*i^2*x^2 + 2*(b*f^2*h^2 - 2*b*e*f*h*i + b*e^2*i^2)*log(c*f*x + c*e)^2 + 2*(4*(a - b)*f^2*h*i
 - (2*a - 3*b)*e*f*i^2)*x + 2*(b*f^2*i^2*x^2 + 2*a*f^2*h^2 - 4*(a - b)*e*f*h*i + (2*a - 3*b)*e^2*i^2 + 2*(2*b*
f^2*h*i - b*e*f*i^2)*x)*log(c*f*x + c*e))/(d*f^3)

________________________________________________________________________________________

giac [A]  time = 0.18, size = 241, normalized size = 1.54 \[ \frac {8 \, b f^{2} h i x \log \left (c f x + c e\right ) + 2 \, b f^{2} h^{2} \log \left (c f x + c e\right )^{2} - 4 \, b f h i e \log \left (c f x + c e\right )^{2} + 8 \, a f^{2} h i x - 8 \, b f^{2} h i x - 2 \, b f^{2} x^{2} \log \left (c f x + c e\right ) + 4 \, a f^{2} h^{2} \log \left (f x + e\right ) - 8 \, a f h i e \log \left (f x + e\right ) + 8 \, b f h i e \log \left (f x + e\right ) - 2 \, a f^{2} x^{2} + b f^{2} x^{2} + 4 \, b f x e \log \left (c f x + c e\right ) + 4 \, a f x e - 6 \, b f x e - 2 \, b e^{2} \log \left (c f x + c e\right )^{2} - 4 \, a e^{2} \log \left (f x + e\right ) + 6 \, b e^{2} \log \left (f x + e\right )}{4 \, d f^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x+h)^2*(a+b*log(c*(f*x+e)))/(d*f*x+d*e),x, algorithm="giac")

[Out]

1/4*(8*b*f^2*h*i*x*log(c*f*x + c*e) + 2*b*f^2*h^2*log(c*f*x + c*e)^2 - 4*b*f*h*i*e*log(c*f*x + c*e)^2 + 8*a*f^
2*h*i*x - 8*b*f^2*h*i*x - 2*b*f^2*x^2*log(c*f*x + c*e) + 4*a*f^2*h^2*log(f*x + e) - 8*a*f*h*i*e*log(f*x + e) +
 8*b*f*h*i*e*log(f*x + e) - 2*a*f^2*x^2 + b*f^2*x^2 + 4*b*f*x*e*log(c*f*x + c*e) + 4*a*f*x*e - 6*b*f*x*e - 2*b
*e^2*log(c*f*x + c*e)^2 - 4*a*e^2*log(f*x + e) + 6*b*e^2*log(f*x + e))/(d*f^3)

________________________________________________________________________________________

maple [B]  time = 0.05, size = 387, normalized size = 2.46 \[ \frac {b \,i^{2} x^{2} \ln \left (c f x +c e \right )}{2 d f}+\frac {a \,i^{2} x^{2}}{2 d f}+\frac {b \,e^{2} i^{2} \ln \left (c f x +c e \right )^{2}}{2 d \,f^{3}}-\frac {b e h i \ln \left (c f x +c e \right )^{2}}{d \,f^{2}}-\frac {b e \,i^{2} x \ln \left (c f x +c e \right )}{d \,f^{2}}+\frac {b \,h^{2} \ln \left (c f x +c e \right )^{2}}{2 d f}+\frac {2 b h i x \ln \left (c f x +c e \right )}{d f}-\frac {b \,i^{2} x^{2}}{4 d f}+\frac {a \,e^{2} i^{2} \ln \left (c f x +c e \right )}{d \,f^{3}}-\frac {2 a e h i \ln \left (c f x +c e \right )}{d \,f^{2}}-\frac {a e \,i^{2} x}{d \,f^{2}}+\frac {a \,h^{2} \ln \left (c f x +c e \right )}{d f}+\frac {2 a h i x}{d f}-\frac {3 b \,e^{2} i^{2} \ln \left (c f x +c e \right )}{2 d \,f^{3}}+\frac {2 b e h i \ln \left (c f x +c e \right )}{d \,f^{2}}+\frac {3 b e \,i^{2} x}{2 d \,f^{2}}-\frac {2 b h i x}{d f}-\frac {3 a \,e^{2} i^{2}}{2 d \,f^{3}}+\frac {2 a e h i}{d \,f^{2}}+\frac {7 b \,e^{2} i^{2}}{4 d \,f^{3}}-\frac {2 b e h i}{d \,f^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((i*x+h)^2*(a+b*ln(c*(f*x+e)))/(d*f*x+d*e),x)

[Out]

2/f^2/d*b*h*i*ln(c*f*x+c*e)*e-1/f^2/d*b*e*i^2*ln(c*f*x+c*e)*x-2/f^2/d*a*e*h*i*ln(c*f*x+c*e)-1/f^2/d*b*e*h*i*ln
(c*f*x+c*e)^2-2/f^2/d*b*e*h*i+2/f^2/d*a*e*h*i+2/f/d*a*h*i*x-1/f^2/d*a*e*i^2*x+1/f^3/d*a*e^2*i^2*ln(c*f*x+c*e)+
1/2/f^3/d*b*e^2*i^2*ln(c*f*x+c*e)^2+1/2/f/d*b*i^2*ln(c*f*x+c*e)*x^2-1/4/f/d*b*i^2*x^2+1/2/f/d*a*i^2*x^2+7/4/f^
3/d*b*e^2*i^2-3/2/f^3/d*a*e^2*i^2+1/f/d*a*h^2*ln(c*f*x+c*e)+1/2/f/d*b*h^2*ln(c*f*x+c*e)^2-2/f/d*b*h*i*x+2/f/d*
b*h*i*ln(c*f*x+c*e)*x+3/2/f^2/d*b*e*i^2*x-3/2/f^3/d*b*e^2*i^2*ln(c*f*x+c*e)

________________________________________________________________________________________

maxima [B]  time = 0.53, size = 351, normalized size = 2.24 \[ 2 \, b h i {\left (\frac {x}{d f} - \frac {e \log \left (f x + e\right )}{d f^{2}}\right )} \log \left (c f x + c e\right ) + \frac {1}{2} \, b i^{2} {\left (\frac {2 \, e^{2} \log \left (f x + e\right )}{d f^{3}} + \frac {f x^{2} - 2 \, e x}{d f^{2}}\right )} \log \left (c f x + c e\right ) - \frac {1}{2} \, b h^{2} {\left (\frac {2 \, \log \left (c f x + c e\right ) \log \left (d f x + d e\right )}{d f} - \frac {\log \left (f x + e\right )^{2} + 2 \, \log \left (f x + e\right ) \log \relax (c)}{d f}\right )} + 2 \, a h i {\left (\frac {x}{d f} - \frac {e \log \left (f x + e\right )}{d f^{2}}\right )} + \frac {1}{2} \, a i^{2} {\left (\frac {2 \, e^{2} \log \left (f x + e\right )}{d f^{3}} + \frac {f x^{2} - 2 \, e x}{d f^{2}}\right )} + \frac {b h^{2} \log \left (c f x + c e\right ) \log \left (d f x + d e\right )}{d f} + \frac {a h^{2} \log \left (d f x + d e\right )}{d f} + \frac {{\left (e \log \left (f x + e\right )^{2} - 2 \, f x + 2 \, e \log \left (f x + e\right )\right )} b h i}{d f^{2}} - \frac {{\left (f^{2} x^{2} + 2 \, e^{2} \log \left (f x + e\right )^{2} - 6 \, e f x + 6 \, e^{2} \log \left (f x + e\right )\right )} b i^{2}}{4 \, d f^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x+h)^2*(a+b*log(c*(f*x+e)))/(d*f*x+d*e),x, algorithm="maxima")

[Out]

2*b*h*i*(x/(d*f) - e*log(f*x + e)/(d*f^2))*log(c*f*x + c*e) + 1/2*b*i^2*(2*e^2*log(f*x + e)/(d*f^3) + (f*x^2 -
 2*e*x)/(d*f^2))*log(c*f*x + c*e) - 1/2*b*h^2*(2*log(c*f*x + c*e)*log(d*f*x + d*e)/(d*f) - (log(f*x + e)^2 + 2
*log(f*x + e)*log(c))/(d*f)) + 2*a*h*i*(x/(d*f) - e*log(f*x + e)/(d*f^2)) + 1/2*a*i^2*(2*e^2*log(f*x + e)/(d*f
^3) + (f*x^2 - 2*e*x)/(d*f^2)) + b*h^2*log(c*f*x + c*e)*log(d*f*x + d*e)/(d*f) + a*h^2*log(d*f*x + d*e)/(d*f)
+ (e*log(f*x + e)^2 - 2*f*x + 2*e*log(f*x + e))*b*h*i/(d*f^2) - 1/4*(f^2*x^2 + 2*e^2*log(f*x + e)^2 - 6*e*f*x
+ 6*e^2*log(f*x + e))*b*i^2/(d*f^3)

________________________________________________________________________________________

mupad [B]  time = 0.35, size = 208, normalized size = 1.32 \[ x\,\left (\frac {i\,\left (2\,a\,f\,h+b\,e\,i-2\,b\,f\,h\right )}{d\,f^2}-\frac {e\,i^2\,\left (2\,a-b\right )}{2\,d\,f^2}\right )+f\,\ln \left (c\,\left (e+f\,x\right )\right )\,\left (\frac {b\,i^2\,x^2}{2\,d\,f^2}-\frac {b\,i\,x\,\left (e\,i-2\,f\,h\right )}{d\,f^3}\right )+\frac {\ln \left (e+f\,x\right )\,\left (2\,a\,e^2\,i^2+2\,a\,f^2\,h^2-3\,b\,e^2\,i^2-4\,a\,e\,f\,h\,i+4\,b\,e\,f\,h\,i\right )}{2\,d\,f^3}+\frac {b\,{\ln \left (c\,\left (e+f\,x\right )\right )}^2\,\left (e^2\,i^2-2\,e\,f\,h\,i+f^2\,h^2\right )}{2\,d\,f^3}+\frac {i^2\,x^2\,\left (2\,a-b\right )}{4\,d\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((h + i*x)^2*(a + b*log(c*(e + f*x))))/(d*e + d*f*x),x)

[Out]

x*((i*(2*a*f*h + b*e*i - 2*b*f*h))/(d*f^2) - (e*i^2*(2*a - b))/(2*d*f^2)) + f*log(c*(e + f*x))*((b*i^2*x^2)/(2
*d*f^2) - (b*i*x*(e*i - 2*f*h))/(d*f^3)) + (log(e + f*x)*(2*a*e^2*i^2 + 2*a*f^2*h^2 - 3*b*e^2*i^2 - 4*a*e*f*h*
i + 4*b*e*f*h*i))/(2*d*f^3) + (b*log(c*(e + f*x))^2*(e^2*i^2 + f^2*h^2 - 2*e*f*h*i))/(2*d*f^3) + (i^2*x^2*(2*a
 - b))/(4*d*f)

________________________________________________________________________________________

sympy [A]  time = 1.66, size = 226, normalized size = 1.44 \[ x^{2} \left (\frac {a i^{2}}{2 d f} - \frac {b i^{2}}{4 d f}\right ) + x \left (- \frac {a e i^{2}}{d f^{2}} + \frac {2 a h i}{d f} + \frac {3 b e i^{2}}{2 d f^{2}} - \frac {2 b h i}{d f}\right ) + \frac {\left (- 2 b e i^{2} x + 4 b f h i x + b f i^{2} x^{2}\right ) \log {\left (c \left (e + f x\right ) \right )}}{2 d f^{2}} + \frac {\left (b e^{2} i^{2} - 2 b e f h i + b f^{2} h^{2}\right ) \log {\left (c \left (e + f x\right ) \right )}^{2}}{2 d f^{3}} + \frac {\left (2 a e^{2} i^{2} - 4 a e f h i + 2 a f^{2} h^{2} - 3 b e^{2} i^{2} + 4 b e f h i\right ) \log {\left (e + f x \right )}}{2 d f^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x+h)**2*(a+b*ln(c*(f*x+e)))/(d*f*x+d*e),x)

[Out]

x**2*(a*i**2/(2*d*f) - b*i**2/(4*d*f)) + x*(-a*e*i**2/(d*f**2) + 2*a*h*i/(d*f) + 3*b*e*i**2/(2*d*f**2) - 2*b*h
*i/(d*f)) + (-2*b*e*i**2*x + 4*b*f*h*i*x + b*f*i**2*x**2)*log(c*(e + f*x))/(2*d*f**2) + (b*e**2*i**2 - 2*b*e*f
*h*i + b*f**2*h**2)*log(c*(e + f*x))**2/(2*d*f**3) + (2*a*e**2*i**2 - 4*a*e*f*h*i + 2*a*f**2*h**2 - 3*b*e**2*i
**2 + 4*b*e*f*h*i)*log(e + f*x)/(2*d*f**3)

________________________________________________________________________________________